<template>
	<qiun-data-charts inScrollView :canvas2d="true" type="line" :opts="opts" :chartData="ecgChartData" />
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		data() {
			return {
				chartData: {},
				opts: {
					dataPointShape: false,
					animation: false,
					update: true, // 关键：是否开启连续更新数据的方法,开启之后就不会抖动了
					duration: 0,
					dataPointShape: false,
					color: ['#d0425a'],
					padding: [5, 0, 5, 0],
					enableScroll: false,
					dataLabel: false,
					legend: {
						show: false
					},
					xAxis: {
						disabled: true,
						axisLine: false
					},
					yAxis: {
						disabled: true,
						disableGrid: true,
						data: [{
							min: -1.5,
							max: 1.5
						}]
					},
					extra: {
						tooltip: {
							splitLine: false,
							showBox: false
						},
						line: {
							type: 'straight',
							width: 1,
							activeType: 'none'
						}
					}
				}
			};
		},
		computed: {
			...mapState(['curAccount'])
		},
		props: {
			ecgChartData: {
				type: Object,
				default: () => {}
			}
		},

		created() {},
		methods: {}
	};
</script>

<style></style>